from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver

from src.day36.practice.add_members import AddMembers


class Memberpage:
    __MEMBER_INFORMATION=(By.CSS_SELECTOR,".jstree-anchor.jstree-clicked")
    def __init__(self,driver:WebDriver):
        self.driver=driver

    def goto_addmembers(self):
        return AddMembers(self.driver)

    def get_member(self):
        self.driver.find_element(*self.__MEMBER_INFORMATION).click()
        mb_list=self.driver.find_elements(By.CSS_SELECTOR,"member_list")
        member_list=[mb.text for mb in mb_list]
        return member_list